package cn.ml.chuji.game.che;

import java.util.Scanner;

public class CheTest {
    public static Che[] ches = new Che[8];
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        initChe();
        int count = 1;
        for(Che che:ches){
            System.out.println(count+che.toString());
            count++;
        }
        System.out.println("请输入你喜欢车的序号：");
        int no = input.nextInt();
        Che che = ches[no-1];
        System.out.println("你要租几天：");
        int tian = input.nextInt();
        double qian = che.pay(tian);
        System.out.println("你租的："+che);
        System.out.println("共租"+tian+"天");
        System.out.println("需要缴费："+qian);

    }


    private static void initChe() {
        ches[0] = new JiaoChe("宝马X6","京111111",800);
        ches[1] = new JiaoChe("宝马550","京222222",600);
        ches[2] = new JiaoChe("宝马X6","京123331",300);
        ches[3] = new JiaoChe("宝马X6","京44444",600);


        ches[4] = new KeChe("金杯","京88888",800,16);
        ches[5] = new KeChe("金龙","京88888",800,16);
        ches[6] = new KeChe("金杯","京88888",800,16);
        ches[7] = new KeChe("金龙","京88888",800,16);

    }
}
